package com.ynet.eq.common.exception;

/**
 * @author 胡超雄
 * @date 2021/7/8 14:12
 * @desc 返回状态封装枚举
 */
public enum ResponseCodeEnum {
    SUCCEED_CODE(200, "SUCCESS"),
    ERROR_CODE(400, "请求出现错误"),
    TOKEN_ERROR_CODE(401, "TOKEN无效"),
    RESPONSE_TIMEOUT(408, "请求超时"),
    RESPONSE_PARAMETER_ERROR(422, "请求参数校验错误"),
    RESPONSE_PARAMETER_TYPE_ERROR(423, "请求参数类型校验错误"),
    RESPONSE_TOO_MUCH(429, "请求过多"),
    RESPONSE_HEADER_FIELD_IS_TOO_LARGE(431, "请求标头字段太大"),
    SERVICE_INTERNAL_ERROR(500, "内部服务器错误"),
    CREATE_FAILURE(424, "创建失败");

    private Integer code;
    private String msg;

    ResponseCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    ResponseCodeEnum(int code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


}
